<yandex>
    <clickhouse_remote_servers>
{% for cluster_name in cluster_list_name %}
      <{{ cluster_name }}>
{% for shards in shard_list %}
            <shard>
                <internal_replication>true</internal_replication>
{% for shard_host in shards.master %}
                <replica>
                    <host>{{ shard_host }}</host>
                    <port>{{ tcp_port }}</port>
                    <user>{{ ch_name }}</user>
                    <password>{{ ch_passwd }}</password>
                </replica>
{% endfor %}
{% for shard_host in shards.replication %}
{% if shards.replication|length%}
                <replica>
                    <host>{{ shard_host }}</host>
                    <port>{{ tcp_port02 }}</port>
                    <user>{{ ch_name }}</user>
                    <password>{{ ch_passwd }}</password>
                </replica>
{% endif %}
{% endfor %}
            </shard>
{% endfor %}
      </{{ cluster_name }}>
{% endfor %}
    </clickhouse_remote_servers>

    <zookeeper-servers>
{% for zk_node in zookeeper_list %}
        <node index="{{loop.index}}">
            <host>{{zk_node}}</host>
            <port>{{zk_port}}</port>
        </node>
{% endfor %}
<session_timeout_ms>30000</session_timeout_ms>
<operation_timeout_ms>10000</operation_timeout_ms>
    </zookeeper-servers>

    <macros>
        <layer>{{ cluster_id }}</layer>
        <shard>{{ shard_id2 }}</shard>
        <replica>{{ hostname }}_02</replica>
    </macros>

    <!-- 数据压缩算法  -->
    <clickhouse_compression>
        <case>
            <min_part_size>10000000000</min_part_size>
            <min_part_size_ratio>0.01</min_part_size_ratio>
            <method>lz4</method>
        </case>
    </clickhouse_compression>

    <networks>
        <ip>::/0</ip>
    </networks>
</yandex>